package router

import (
	"haodayizhi/controll"
	middleware "haodayizhi/middle_ware"

	"github.com/gin-gonic/gin"
)

func Auth(router *gin.RouterGroup) {
	// 不需要鉴权的
	router.POST("/register", controll.RegisterHandler)
	router.POST("/login", controll.LoginHandler)
	// 获取用户权限
	router.GET("/permiss", middleware.AuthMiddleware(), controll.GetUserPermission)
	// 获取角色列表
	router.GET("/role", middleware.AuthMiddleware(), controll.GetRoleList)
	// 发送登录验证邮件
	router.POST("/send_email_code", controll.SendLoginEmail)
}
